#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char arr[1100];
	cin >> arr;
	int len = strlen(arr);
	for (int i = len - 1; i >= 0; i--)
	{
		if (((arr[i] >= 'a' && arr[i] <= 'z' || arr[i] >= 'A' && arr[i] <= 'Z') &&
			(arr[i - 1] == ' '))||arr[0]!=' ')
		{
			if (arr[i] >= 'a' && arr[i] <= 'z')
			{
				arr[i] -= 32;
			}
		}
	}
	for (int i = 0; i < len; i++)
	{
		cout << arr[i];
	}
	return 0;
}